import request from '@/utils/request'

const docsPromptApi = {
    /**
     * 提示词列表
     */
    lists(params: {
        page_no?: number;
        page_size?: number;
        name?: string;
    }): Promise<any> {
        return request.get({
            url: '/apply/docs/prompt/lists',
            params
        })
    },

    /**
     * 提示词详情
     */
    detail(id: number): Promise<any> {
        return request.get({
            url: '/apply/docs/prompt/detail',
            params: {
                id
            }
        })
    },

    /**
     * 提示词新增
     */
    add(params: {
        icon: string;
        name: string;
        intro: string;
        is_disable: number;
        dialogue_conf: any;
        abstract_conf: any;
    }): Promise<any> {
        return request.post({
            url: '/apply/docs/prompt/add',
            params
        })
    },

    /**
     * 提示词编辑
     */
    edit(params: {
        id: number;
        icon: string;
        name: string;
        intro: string;
        is_disable: number;
        dialogue_conf: any;
        abstract_conf: any;
    }): Promise<any> {
        return request.post({
            url: '/apply/docs/prompt/edit',
            params
        })
    },

    /**
     * 提示词删除
     */
    delete(id: number): Promise<any> {
        return request.post({
            url: '/apply/docs/prompt/delete',
            params: {
                id
            }
        })
    }
}

export default docsPromptApi
